﻿<!--#include file="conn.asp"-->
<%if request("act")="save" then%><%

Num=300
for i=1 to Num
    id=request.form("id"&i)
    classid=request.form("classid"&i)
    dqid=trim(request.Form("dqid"&i))
	if classid="" then
Num=i-1
exit for
end if
set rs=server.createobject("adodb.recordset")
sql="select * from comics where id="&id
rs.open sql,conn,1,3
		rs("classid")=classid
		rs("dqid")=dqid
		rs.update
		rs.close
next
response.write("<script>alert('修改"&num&"个漫画类别成功!');location.href='comics_manage.asp'</script>")
response.end
set rs=nothing
conn.close
set conn=nothing
end if%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="images/style.css" type="text/css" rel="stylesheet">
    <meta content="MSHTML 6.00.3790.0" name="GENERATOR">
    <style type="text/css">
<!--
.STYLE1 {font-weight: bold}
-->
</style>
</head>
<body style="font-size: 12px; v-text-align: center" leftmargin="0" topmargin="3"
    align="center" marginheight="0" marginwidth="0">
    <form name="form1" method="post" action="?act=save">
    <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
        <tr>
            <td height="30" colspan="8" bgcolor="e1e1e1">
                <div align="center">
                    批量修改</div>
            </td>
        </tr>
        <% 
id=replace(request("id"),"","")
if request("id")="" then
response.write("<script>alert('错误：漫画没有选择!');history.go(-1)</script>")
response.end
end if%>
        <%i=0
set rs=server.createobject("adodb.recordset")
sql="select * from comics where id in (" & id & ")"
rs.open sql,conn,1,1
while not rs.eof
    id=rs("id")
	classid=rs("classid")
	dqid=rs("dqid")
	mhmc=rs("mhmc")
    mhtc=rs("mhtc")
i=i+1
        %>
        <tr>
            <td width="13%" bgcolor="#FFFFFF">
                <div align="right">
                    <span class="STYLE1">
                        <%=i%></span>、名称：</div>
            </td>
            <td width="18%" bgcolor="#FFFFFF">
                <input name="id<%=i%>" type="hidden" id="id" value="<%=id%>" size="20"><input name="mhmc<%=i%>"
                    type="text" id="title" value="<%=mhmc%>" size="20">
            </td>
            <td width="5%" bgcolor="#FFFFFF">
                <div align="center">
                    类别:</div>
            </td>
            <td width="17%" bgcolor="#FFFFFF">
                <select name="classid<%=i%>" size="1" id="DL_ID<%=i%>">
                    <option value="">未选择</option>
                    <%set rs2=conn.execute("select * from class order by ID desc")
						  do while not rs2.eof%>
                    <option value="<%=rs2("ID")%>" <%if rs2("ID")=classid then response.Write("selected")%>>
                        <%=rs2("classname")%></option>
                    <%rs2.movenext
						  loop
						  set rs2=nothing%>
                </select>
                <a href="http://www.baidu.com/s?wd=<%=mhmc%>" target="_blank">查询</a>
            </td>
            <td width="9%" bgcolor="#FFFFFF">
                <div align="center">
                    地区:</div>
            </td>
            <td width="18%" bgcolor="#FFFFFF">
                <select name="dqid<%=i%>" size="1" id="dqid">
                    <option value="">未选择</option>
                    <%set rs2=conn.execute("select * from diqu order by id desc")
						  do while not rs2.eof%>
                    <option value="<%=rs2("iD")%>" <%if rs2("ID")=dqid then response.Write("selected")%>>
                        <%=rs2("diqu")%></option>
                    <%rs2.movenext
						  loop
						  set rs2=nothing%>
                </select>
            </td>
            <td width="9%" bgcolor="#FFFFFF">
                <div align="center">
                    题材:</div>
            </td>
            <td width="18%" bgcolor="#FFFFFF">
                <%=mhtc%>
            </td>
        </tr>
        <%rs.movenext
wend
rs.Close
set rs=nothing%>
        <tr>
            <td colspan="8" bgcolor="#FFFFFF">
                <div align="center">
                    <input name="goback" type="button" class="Submit" id="goback" value="返回" onclick="history.go(-1)">
                    &nbsp;
                    <input name="newrank" type="submit" class="Submit" id="newclass" value="批量修改">
                </div>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
